package ex.datastream.connectors;


import ex.datastream.functions.function.FilterFunc;
import ex.vo.Person;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 示例：基于集合读取数据源
 */
public class CollectionTest01 {

    public static void main(String[] args) throws Exception {
        final StreamExecutionEnvironment env =
                StreamExecutionEnvironment.getExecutionEnvironment();
        DataStream<Person> dataStream = env.fromElements(
                new Person("Fred", 35),
                new Person("Wilma", 35),
                new Person("Pebbles", 2)).disableChaining();

        DataStream<Person> personDataStream = dataStream.filter(new FilterFunc());
        personDataStream.print();
        env.execute();
    }


}